package design.simdi.code.final_paper.site.panels.licente.candidati;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.StudentCandidatDao;
import design.simdi.code.final_paper.core.entities.StudentCandidat;

/**
 * 
 * @author Marius Dumitriu - (Jun 25, 2010 - 1:39:44 AM)
 * 
 */
public class DetachableCandidatModel extends LoadableDetachableModel<StudentCandidat> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final StudentCandidatDao studentCandidatDao;

	public DetachableCandidatModel(StudentCandidat object, StudentCandidatDao keywordDao) {
		super(object);
		this.id = object.getId();
		this.studentCandidatDao = keywordDao;
	}

	@Override
	protected StudentCandidat load() {
		return studentCandidatDao.get(id);
	}

}
